package com.easygem.front.converter;

import com.easygem.common.model.system.User;
import com.easygem.common.vo.front.SeatVO;
import org.springframework.beans.BeanUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 廖思炜
 * @version 1.0
 * @className SeatConverter
 * @Description TODO 用户转换坐席前端实体类
 * @date 2025/3/25 9:14
 */
public class SeatConverter {

    public static SeatVO convert(User user) {
        SeatVO seatVO = new SeatVO();
        BeanUtils.copyProperties(user, seatVO);
        return seatVO;
    }

    public static List<SeatVO> convert(List<User> users) {
        List<SeatVO> seatVOs = new ArrayList<SeatVO>();
        users.forEach(user -> {
            SeatVO seatVO = convert(user);
            seatVOs.add(seatVO);
        });
        return seatVOs;
    }
}
